namespace Maple.Branch.Identity.Services
{
    using System;
    using System.Threading.Tasks;
    using IRepositories;
    using IServices;
    using Volo.Abp.DependencyInjection;

    public class UserRoleFindService : IUserRoleFindService, ITransientDependency
    {
        protected IIdentityUserRepository IdentityUserRepository { get; }

        public UserRoleFindService(IIdentityUserRepository identityUserRepository)
        {
            IdentityUserRepository = identityUserRepository;
        }

        public virtual async Task<string[]> GetRolesAsync(Guid userId)
        {
            return (await IdentityUserRepository.GetRoleNamesAsync(userId)).ToArray();
        }
    }
}
